package com.xiaotao.mapper;

import com.xiaotao.entity.TeamPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface TeamPostMapper {
    int insert(TeamPost teamPost);
    TeamPost selectById(Long id);
    List<TeamPost> selectPage(@Param("offset") int offset, @Param("size") int size);
    List<TeamPost> selectByCategory(String category);
    int incrementViewCount(Long id);
    int incrementLikeCount(Long id);
    int decrementLikeCount(Long id);
    int update(TeamPost teamPost);
    int softDelete(Long id);
    List<TeamPost> selectByUserId(Integer userId);
    List<TeamPost> selectRecommended();
    int updateRecommendScore(TeamPost teamPost);
    List<TeamPost> selectUserLikedPosts(Integer userId);
    List<TeamPost> selectAllActivePosts();
    int checkUserLikePost(@Param("userId") Integer userId, @Param("postId") Long postId);
}